LSARetrievePrivateData (advapi32)
Last changed: -212.242.131.193

.
Summary
The LsaRetrievePrivateData function retrieves private data that was stored by the LsaStorePrivateData function.

C# Signature:

[DllImport("advapi32.dll")]
private static extern UInt32 LsaRetrievePrivateData(
     IntPtr policyHandle,
     [MarshalAs(UnmanagedType.CustomMarshaler,MarshalTypeRef=typeof(LSAStringMarshaler))] string KeyName,
     [MarshalAs(UnmanagedType.CustomMarshaler,MarshalTypeRef=typeof(LSAStringMarshaler))] ref string PrivateData
);

VB Signature:

Declare Function LSARetrievePrivateData Lib "advapi32.dll" (TODO) As TODO
REM Sorry no signature here, I don't grok BASIC.

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

See LsaOpenPolicy for the custom marshaler and some more info on it.

Tips & Tricks:

Do not use the LSA private data functions. Instead, use the CryptProtectData and CryptUnprotectData functions.

(However, these won't do when you need to modify COM RunAs Passwords ...)

Sample Code:

Please add some!

Documentation